//
//  RHAgencyApplyResultVC.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/7/26.
//

#import "RHAgencyApplyResultVC.h"
#import "RHApplicationListController.h"

@interface RHAgencyApplyResultVC ()

@end

@implementation RHAgencyApplyResultVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"Submit Results";
    [self setupUI];
}
-(void)setupUI
{
    UIImageView *resultImg = kImageView;
    [self.view addSubview:resultImg];
    resultImg.contentMode = UIViewContentModeCenter;
    [resultImg setImage:[UIImage imageNamed:@"submit_success"]];
    resultImg.layer.cornerRadius = kScaleW(80)/2.0;
    resultImg.layer.borderColor = CMainColorGreen.CGColor;
    resultImg.layer.borderWidth = 3;
    [resultImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.offset(kScaleW(80));
            make.height.equalTo(resultImg.mas_width);
        make.top.equalTo(self.view).offset(kScaleW(40)+kSafe_top);
        make.centerX.equalTo(self.view);
    }];
    QMUILabel *resultLab = [[QMUILabel alloc]init];
    [self.view addSubview:resultLab];
    resultLab.text = @"Submitted Successfully";
    resultLab.textColor = CMainColorGreen;
    [resultLab setFont:[UIFont boldSystemFontOfSize:20]];
    [resultLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(resultImg.mas_bottom).offset(20);
        make.centerX.equalTo(resultImg);
    }];
    
    QMUIButton *statueBtn = [QMUIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:statueBtn];
    statueBtn.layer.borderColor = kRGB(140, 140, 140).CGColor;
    statueBtn.layer.borderWidth = 1;
    [statueBtn setCornerRadius:8];
    [statueBtn setTitle:@"Audit Status" forState:UIControlStateNormal];
    [statueBtn setTitleColor:kRGB(30, 30, 30) forState:UIControlStateNormal];
    
    QMUIButton *backBtn = [QMUIButton buttonWithType:UIButtonTypeCustom];
    [self.view addSubview:backBtn];
    backBtn.backgroundColor = CMainColorGreen;
    [backBtn setCornerRadius:8];
    [backBtn setTitle:@"Go Back" forState:UIControlStateNormal];
    [backBtn setTitleColor:kRGB(30, 30, 30) forState:UIControlStateNormal];
    
    [statueBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(kScaleW(30));
        make.centerY.equalTo(self.view);
        make.height.offset(kScaleW(45));
    }];
    [backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(statueBtn.mas_right).offset(kScaleW(30));
        make.right.equalTo(self.view).offset(-kScaleW(30));
        make.centerY.equalTo(statueBtn);
        make.height.equalTo(statueBtn.mas_height);
        make.width.equalTo(statueBtn.mas_width);
    }];
    kWeakSelf;
    [[backBtn rac_signalForControlEvents:UIControlEventTouchUpInside]subscribeNext:^(__kindof UIControl * _Nullable x) {
        [weakSelf.navigationController popToRootViewControllerAnimated:YES];
    }];
    
    [[statueBtn rac_signalForControlEvents:UIControlEventTouchUpInside]subscribeNext:^(__kindof UIControl * _Nullable x) {
        RHApplicationListController *vc = [[RHApplicationListController alloc]init];
        vc.title = @"我的申请".rh_localized;
        [weakSelf.navigationController pushViewController:[[RHApplicationListController alloc]init] animated:YES];
    }];
}


@end
